{template header}
<form class="form-horizontal" action="index.php?c=admin&a=dealMedal" method="post">
    <div class="control-group">
        <label class="control-label" for="inputShortDesc">勋章：</label>
        <div class="controls">
            <select name="medal_id" id="type">
                {loop $medals $k $v}
                <option value="{$v['medal_id']}" {if $v['medal_id']==$medal_id}selected{/if}>{$v['medal_name']}</option>
                {/loop}
            </select>
        </div>
    </div>
    <div class="control-group">
        <label class="controls">用户ID</label>
        <div class="controls">
            <textarea name="uid" placeholder="用户id，半角分号;隔开">{$uid}</textarea>
        </div>
    </div>
    <div class="control-group">
        <label class="controls">跑步记录（可选）</label>
        <div class="controls">
            <input name="did" value="{$did}">
        </div>
    </div>
    <div class="secondShow control-group" style="display:none">
        <label class="control-label" for="inputShortDesc">最佳成绩（可选）：</label>
        <div class="controls">
            <input type="text" name="second" value=""/> <span class="label">单位为秒</span>
        </div>
    </div>
    <div class="control-group" {if !$medal_id}style="display:none"{/if}>
        <label class="controls">已发数量：{$number}</label>
    </div>
    <div class="control-group">
        <div class="controls">
            <button type="submit" class="btn">提交</button>
        </div>
    </div>
</form>

<script type="text/javascript">
$('#type').on('change', function() {
    var mid = $(this).val() * 1;
    var showSecondMids = [126, 127, 128, 129];

    if((',' + showSecondMids.join(',') + ',').indexOf(',' + mid + ',') != -1) {
        $('.secondShow').show();
    } else {
        $('.secondShow').hide();
    }
});
</script>

{template footer}